home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
LDB171.ARJ
/
EXAMP304.CPP
< prev
next >
Wrap
Text File
|
1992-05-12
|
667b
|
25 lines
// examp304.cpp - link with binder.obj
#include "binder.hpp"
int v[] = { 25, 3, 43, 17, 7, 35, 3 };
int intcmp(const int *I1, const int *I2)
{ return (*I1 - *I2); }
main()
{
Binder b;
b.setComP ((BDRcomP) intcmp);
for (int i = 0; i < sizeof(v)/sizeof(v[0]); i++)
b.insSort ((voiD) &v[i]);
i = 3;
cout << "\n" << b.findAll(&i) << " " << i
<< "'s are present in the following "
"sort Binder.\n\n";
while (b.next())
cout << *(int *)b.get() << "\n";
return 0;
}